﻿@model CMSApplication.Areas.Administration.Models.GalleryModel

@{
    ViewBag.Title = "Add Gallery";
}

<script type="text/javascript">
    $(document).ready(function () {
        /////// Add Multiplte
        var max_input = 11;
        var now_input = 0;
        jQuery("#addfile").click(function () {
            now_input++;
            if (now_input >= max_input)
                return false;
            //add file
            var input = document.createElement("input");
            input.type = "file";
            input.name = "FileUp";

            //---
            jQuery('#upload_list').append(input);
            jQuery('#upload_list').find("input:file").not(".skip").uniform();
        });
        //////////End 
    });

</script>

<div class="row-fluid">
    <div class="span12">
        <div class="head">
            <div class="isw-documents">
            </div>
            <h1>
               Edit Gallery</h1>
            <div class="clear">
            </div>
        </div>
        <div class="block-fluid">
                @using (Html.BeginForm("CreateOrUpdateGallery", "GalleryManager", FormMethod.Post, new { enctype = "multipart/form-data" }))
                {
                    @Html.HiddenFor(model => model.ID)
                    @Html.HiddenFor(model => model.OrderImage)
                        <div class="warning-area">
                        </div>
                        <div class="row-form">
                            <div class="span2">
                                Choose catalog galery :</div>
                            <div class="span5">
                                @Html.DropDownList("CatalogID", null, "-- Select one --", new { id = "CatalogID" })</div>
                              <div class="clear"></div>
                        </div>
                        <div class="row-form">
                            <div class="span2">
                                Gallery Name</div>
                            <div class="span5">
                                @Html.TextBoxFor(x => x.Name, new { @class = "span8" })</div>
                              <div class="clear"></div>
                        </div>

                        <div class="row-form">
                            <div class="span2">
                                Upload File :</div>
                            <div class="span5" id="upload_list">
                                <input type="file" multiple name="FileUp" />
                            </div>
                            <div class="span3">
                                <img src="@Url.Content("~/Content/File/Remsigns/" + Model.Thumbnail)" />
                                </div>
                            <div class="clear"></div>                            
                        </div>
                        

                        <div class="row-form">
                            <div class="span4">
                                  <input type="submit" class="btn btn-info btnSubmit" value="Submit" />
                            </div>
                            <div class="span8">
                               <span style="color:red">@ViewBag.Message</span>
                              </div>
                              <div class="clear"></div>
                        </div>
                }
            </div>
        </div>
    </div>

